/**
 * Created by yaqiangbi on 2017/6/13.
 */
$(document).ready(function () {
    //$("span").parent().css({"color":"blue","border":"2px solid blue"});
    //$("span").parents("ul").css({"color":"red","border":"2px solid red"});
    //$("span").parent("p").parentsUntil("html").css({"color":"green","border":"2px solid green"});

    // $("div").children().css({"color":"orange","border":"2px solid orange"});
    // $("div").children("p.1").css({"color":"gray","border":"2px solid gray"});
    // $("div").find("span").css({"color":"red","border":"2px solid red"});
    // $("span").siblings().css({"color":"green","border":"2px solid green"});
    // $("span").siblings("h5").css({"color":"yellow","border":"2px solid yellow"});
    // $("h5").next().css({"color":"cyan","border":"2px solid cyan"});

    $("div p").first().css({"color":"red","border":"2px solid red"});
    $("div p").last().css({"color":"orange","border":"2px solid orange"});
    $("p").eq(1).css({"color":"yellow","border":"2px solid yellow"});
    $("span").filter(".green").css({"color":"green","border":"2px solid green"});
    $("span").not(".green").css({"color":"cyan","border":"2px solid cyan"});
});